import request from '@/utils/request'

// 查询计时器列表
export function listTimer(query) {
  return request({
    url: '/system/timer/list',
    method: 'get',
    params: query
  })
}

// 查询计时器详细
export function getTimer(id) {
  return request({
    url: '/system/timer/' + id,
    method: 'get'
  })
}

// 是否存在计时器
export function haveTimer(todoId) {
  return request({
    url: '/system/timer/have/' + todoId,
    method: 'get'
  })
}

// 新增计时器
export function addTimer(data) {
  return request({
    url: '/system/timer',
    method: 'post',
    data: data
  })
}

// 中止计时器
export function stopTimer(id) {
  return request({
    url: '/system/timer/stop/'+id,
    method: 'get'
  })
}
export function continueTimer(id) {
  return request({
    url: '/system/timer/continue/'+id,
    method: 'get'
  })
}
// 删除计时器
export function delTimer(id) {
  return request({
    url: '/system/timer/' + id,
    method: 'delete'
  })
}
